<table cellspacing="1" cellpadding="4">
    <tr align="center" valign="top">
        <td width="*" align="center" valign="top"><!-- ######### begin ######### -->
            <div class="Block">
            <?php echo $this->renderPartial('add');?>
            <table cellspacing="1" cellpadding="4" class="tab">
                <tr class="sub align-center nodrag">
                    <td width="10%">编号</td>
                    <td width="20%" class="align-left">模块名</td>
                    <td width="50%" class="align-left">链接</td>
                    <td width="20%">管理</td>
                </tr>
                <?php foreach ($this->model->findAll('menu_parent_id=0') as $row): ?>
                    <tbody>
                        <tr class="rows nodrag">
                            <td class="align-center"><?php echo $row['menu_id']; ?></td>
                            <td><a href="#"><img src="<?php echo Yii::app()->request->baseUrl; ?>/public/admin/ico_switch_open.gif" width="10" height="11" border="0" /></a> <?php echo $row['menu_name']; ?></td>
                            <td></td>
                            <td class="align-center"><?php echo ToolsBar::edit($this->createUrl('menu/edit', array('id' => $row['menu_id']))); ?><?php echo ToolsBar::del($this->createUrl('menu/del', array('id' => $row['menu_id']))); ?></td>
                        </tr>
                    </tbody>
                    <?php foreach ($this->model->findAll('menu_parent_id=:id', array(':id' => $row['menu_id'])) as $val): ?>
                        <tbody>
                            <tr class="row">
                                <td class="align-center"><?php echo $val['menu_id']; ?></td>
                                <td style="padding-left: 40px;"><?php echo $val['menu_name']; ?></td>
                                <td><?php echo $val['menu_link']; ?></td>
                                <td class="align-center"><?php echo ToolsBar::edit($this->createUrl('menu/edit', array('id' => $val['menu_id']))) . ToolsBar::del($this->createUrl('menu/del', array('id' => $val['menu_id']))); ?></td>
                            </tr>
                        </tbody>
                    <?php endforeach; ?>
                <?php endforeach; ?>
            </table>
            </div>
        </td>
    </tr>
</table>